package com.gancp.service.base;


import com.gancp.dao.IBaseMapper;

/**
 * Created by GCP on 2018/5/10.
 */
public abstract class BaseBizImpl<T, K> implements IBaseBiz<T, K> {


    abstract protected IBaseMapper getIBaseMapper();

    @Override
    public int deleteByPrimaryKey(K id) {
        return getIBaseMapper().deleteByPrimaryKey( id );
    }

    @Override
    public int insert(T record) {
        return getIBaseMapper().insert( record );
    }

    @Override
    public int insertSelective(T record) {
        return getIBaseMapper().insertSelective( record );
    }

    @Override
    public T selectByPrimaryKey(K id) {
        return (T) getIBaseMapper().selectByPrimaryKey( id );
    }

    @Override
    public int updateByPrimaryKeySelective(T record) {
        return getIBaseMapper().updateByPrimaryKeySelective( record );
    }

    @Override
    public int updateByPrimaryKey(T record) {
        return getIBaseMapper().updateByPrimaryKey( record );
    }
}
